<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="UploadPDF.do" method="post" name="frm" id="frm" enctype="multipart/form-data" cssStyle="width:100%">
			<input type="file"  name="upload" id="upload"/>
			</form>
<script type="text/javascript" src="js/jquery.min.1.4.2.js"></script>
<script type="text/javascript" src="js/jquery.form.min.js"></script>
<script type = "text/javascript">

$('#upload').bind('change',subFrm);
function subFrm(){
	
	var options = {
	    dataType: 'json',
    	iframe:	false,
	    success:function(data){
		//closeFloatBoxBg();
		console.log(data);
			if(data != null){
	    		alert("File upload failed!");
	      	}else{
	      		alert("编译成功!");
	      		window.location = window.location;
	      	}
   	}
	};
    $('#frm').ajaxSubmit(options);

}

</script>
</body>
</html>